package com.cloud.code.真题;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {

            int n = scanner.nextInt();
            int m = scanner.nextInt();
            List<Integer> list = new ArrayList<>();
            for (int i = 0; i < m; i++) {
                list.add(scanner.nextInt());
            }

            int k = scanner.nextInt();

            int left = 0;
            int right = 1;
            int max = 0;
            int count = 0;
            while (right <= n) {

                if (list.contains(right)) {
                    if (count >= k) {
                        max = Math.max(right - left, max);
                        count--;
                        while (true) {
                            left++;
                            if (list.contains(left)) {
                                break;
                            }
                        }
                    } else {
                        count++;
                    }


                }

                if (right == n) {
                    max = Math.max(max, right - left);
                }

                right++;

            }


            System.out.println(max);


        }


    }
}